import {observable,action} from 'mobx';
import {voteList,submitVote,submitVoteBody} from '../../services/vote';

export default class Vote{
    @observable votelist:any[] = [];

    @action
    getList = async () =>{
        const res = await voteList();
        this.votelist = res.data.lists;
    }

    @action
    submitVote = async (body:submitVoteBody) => {
        await submitVote(body)
    }
}
